-------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/AliceZhang/Dropbox/Research_Columbia/Renewables Voting (Urp
> elainen Zhang)/JOP/UZ_JOP2021_Replication/Analysis/logSTATA/008_robustness_co
> mments.smcl
  log type:  smcl
 opened on:   6 Nov 2021, 20:34:06

. 
. 
. *****************************************************************************
> **
. /*                                        URPELAINEN & ZHANG 2021            
>                                     */
. *****************************************************************************
> **
. 
. /* 
> 
> File Name:      008_robustness_comments.do
> 
> By:                             Alice Tianbo Zhang (alice.tianbo.zhang@gmail.
> com)
> 
> Last Edited:    10/11/2021
> 
> Purpose:                
> 
> Data Used:      votes_wind_panel.dta
> 
> Program Used:   - reghdfe -
> 
> */
. 
. *****************************************************************************
> **
. /*                                      Instrument Stationarity              
>                                 */
. *****************************************************************************
> **
. 
. ** Load wind votes panel
. cd "$rootDir/$dataDir/Final"
/Users/AliceZhang/Dropbox/Research_Columbia/Renewables Voting (Urpelainen Zhang
> )/JOP/UZ_JOP2021_Replication/Data/Final

. use votes_wind_panel.dta, clear

. 
. ** Create instrument and fixed effects
. gen t = year - 2003

. gen inter = t * mean_wp

. 
. egen stateyear_fixed = group(state year)

. egen district_fixed = group(state district)

. 
. gen cum_lncapacity_turbine = log(cum_capacity_turbine + 1)

. gen cum_lncount_turbine = log(cum_count_turbine +1 )

. 
. 
. *------------------- Check for stationarity of instrument -------------------
> -*
. // Note: the instrument is a time-invariant variable (mean wind potential) * 
> time trend, so it should be stationary by construction
. xtdescribe

 panelID:  9, 10, ..., 434                                   n =        287
    year:  2003, 2004, ..., 2012                             T =         10
           Delta(year) = 1 unit
           Span(year)  = 10 periods
           (panelID*year uniquely identifies each observation)

Distribution of T_i:   min      5%     25%       50%       75%     95%     max
                        10      10      10        10        10      10      10

     Freq.  Percent    Cum. |  Pattern
 ---------------------------+------------
      287    100.00  100.00 |  1111111111
 ---------------------------+------------
      287    100.00         |  XXXXXXXXXX

. xtunitroot ht inter, demean trend //  assume all panels share the same autore
> gressive parameter and N --> infinity, T is fixed

Harris-Tzavalis unit-root test for inter
----------------------------------------
Ho: Panels contain unit roots               Number of panels  =    287
Ha: Panels are stationary                   Number of periods =     10

AR parameter: Common                        Asymptotics: N -> Infinity
Panel means:  Included                                   T Fixed
Time trend:   Included                      Cross-sectional means removed
------------------------------------------------------------------------------
                    Statistic         z         p-value
------------------------------------------------------------------------------
 rho                 -0.1711      -25.9036       0.0000
------------------------------------------------------------------------------

. 
. 
. *****************************************************************************
> **
. /*                                                      TABLE A21            
>                                                 */
. *****************************************************************************
> **
. 
. *--------------------- Placebo test in districts w/o wind -------------------
> -* 
. use votes_wind_panel.dta, clear

. gen t = year - 2003

. gen inter = t * mean_wp

. 
. egen stateyear_fixed = group(state year)

. egen district_fixed = group(state district)

. 
. gen cum_lncapacity_turbine = log(cum_capacity_turbine + 1)

. gen cum_lncount_turbine = log(cum_count_turbine +1 )

. 
. ** Check the effect of instrument on environmental voting outcomes for distri
> cts with no wind power
. reghdfe pro_env inter if cum_capacity_turbine == 0 & raceyear > 2003, absorb(
> stateyear_fixed district_fixed) vce(cluster district_fixed)
(dropped 35 singleton observations)
(MWFE estimator converged in 9 iterations)

HDFE Linear regression                            Number of obs   =      1,713
Absorbing 2 HDFE groups                           F(   1,    238) =       0.05
Statistics robust to heteroskedasticity           Prob > F        =     0.8189
                                                  R-squared       =     0.8842
                                                  Adj R-squared   =     0.8479
                                                  Within R-sq.    =     0.0000
Number of clusters (district_fixed) =        239  Root MSE        =    15.3675

                       (Std. Err. adjusted for 239 clusters in district_fixed)
------------------------------------------------------------------------------
             |               Robust
     pro_env |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       inter |  -.1144223   .4992476    -0.23   0.819    -1.097931    .8690862
       _cons |   62.96065   4.109534    15.32   0.000     54.86495    71.05636
------------------------------------------------------------------------------

Absorbed degrees of freedom:
---------------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
-----------------+---------------------------------------|
 stateyear_fixed |       170           0         170     |
  district_fixed |       239         239           0    *|
---------------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store pro_reduced

. reghdfe anti_env inter if cum_capacity_turbine == 0 & raceyear > 2003, absorb
> (stateyear_fixed district_fixed) vce(cluster district_fixed)
(dropped 35 singleton observations)
(MWFE estimator converged in 9 iterations)

HDFE Linear regression                            Number of obs   =      1,713
Absorbing 2 HDFE groups                           F(   1,    238) =       0.12
Statistics robust to heteroskedasticity           Prob > F        =     0.7330
                                                  R-squared       =     0.8890
                                                  Adj R-squared   =     0.8542
                                                  Within R-sq.    =     0.0001
Number of clusters (district_fixed) =        239  Root MSE        =    14.8268

                       (Std. Err. adjusted for 239 clusters in district_fixed)
------------------------------------------------------------------------------
             |               Robust
    anti_env |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       inter |  -.2036898   .5963818    -0.34   0.733    -1.378551    .9711713
       _cons |   36.01152    4.90909     7.34   0.000      26.3407    45.68234
------------------------------------------------------------------------------

Absorbed degrees of freedom:
---------------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
-----------------+---------------------------------------|
 stateyear_fixed |       170           0         170     |
  district_fixed |       239         239           0    *|
---------------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store anti_reduced

. 
. ** Export LaTeX tables (IV estimates only) 
. cd "$rootDir/$resultDir/Tables"
/Users/AliceZhang/Dropbox/Research_Columbia/Renewables Voting (Urpelainen Zhang
> )/JOP/UZ_JOP2021_Replication/Results/Tables

. esttab pro_reduced anti_reduced using TableA21.tex, booktabs replace ///
>                 refcat(cum_capacity_turbine "\emph{Panel: Reduced Form}", nol
> abel) ///
>                 b(%9.3f) se noconstant nonotes legend star(* 0.10 ** 0.05 ***
>  0.01) ///
>                 varlabels(inter "Mean wind potential * time") varwidth(27) mo
> delwidth(13) ///
>                 mtitles("Pro-Environment Vote" "Anti-Environment Vote") ///
>                 stats(N N_clust r2, labels("Observations" "Districts" "\(R^{2
> }\)") fmt(0 0 2)) ///
>                 width(\hsize)
(output written to TableA21.tex)

.                 
.                 
. ** Close log file
. log close
      name:  <unnamed>
       log:  /Users/AliceZhang/Dropbox/Research_Columbia/Renewables Voting (Urp
> elainen Zhang)/JOP/UZ_JOP2021_Replication/Analysis/logSTATA/008_robustness_co
> mments.smcl
  log type:  smcl
 closed on:   6 Nov 2021, 20:34:10
-------------------------------------------------------------------------------
